/*
 * @Description: robot_chassis_node
 * @Version: V1.0
 * @Author: zw_1520@163.com
 * @Date: 2025-08-21 11:30:06
 * @LastEditors: zw_1520@163.com
 * @LastEditTime: 2025-08-21 11:31:35
 * Copyright (C) 2024-2050 Lens All rights reserved.
 */

#include "robot_chassis.h"
#include "motor_control_utils.h"

int main(int argc, char **argv) {
  // Initializes ros node
  rclcpp::init(argc, argv);
  // open the CAN channel, initialize motor, and it takes a certain amount of time for the motor to return to the origin
  MotorControlUtils::motorControllerInit();

  rclcpp::Node::SharedPtr node_ptr = std::make_shared<ChassisController>();

  // Initializes robot chassis controller
  auto executor = std::make_shared<rclcpp::executors::MultiThreadedExecutor>();
  executor->add_node(node_ptr);

  // Starts executor
  executor->spin();

  // Shutdown node
  rclcpp::shutdown();
  return 0;
}